<template>
    <div class="wrapper">
        <h2>按钮组件</h2>
        <div class="shape">
            <h3>效果展示</h3>
            <div class="showButton">
                <h4>支持主题选择:button,link,text</h4>
                <div class="zgn-button-show">
                    <Button  theme="button">确认</Button>
                    <Button  theme="link">www.baidu.com</Button>
                    <Button  theme="text">确认</Button>
                </div>
                <h4>支持尺寸选择:big,normal,small</h4>
                <div class="zgn-button-show">
                    <Button  size="big" >确认</Button>
                    <Button  size="normal">确认</Button>
                    <Button  size="small">确认</Button>
                </div>
                <div class="zgn-button-show">
                    <Button  size="big" theme="link">www.baidu.com</Button>
                    <Button  size="normal" theme="link">www.baidu.com</Button>
                    <Button  size="small" theme="link">www.baidu.com</Button>
                </div>
                <h4>支持含义:yes,no</h4>
                <div class="zgn-button-show">
                    <Button  purpose="yes" theme="button">确认</Button>
                    <Button  purpose="no" theme="button">取消</Button>
                    <Button  purpose="no" theme="link">危险链接 www.baidu.com</Button>
                    <Button  purpose="no" theme="text">取消</Button>
                </div> 
            </div> 
            
        </div>
        <div class="markdown-body">
<pre><code>{{
`<Button  theme="button" size="normal" purpose="yes" >确认</Button> 
<!-- 默认值：theme="button" size="normal" purpose="yes"-->`
}}</code></pre>
        </div>
        <div class="shape">
            <h3 @click="getCode">查看源码</h3>
            <main class="markdown-body" v-show="code">
<pre><code>{{
`<template>
    <Button  theme="button" size="normal" purpose="yes" >确认</Button> 
</template>
    
<script lang="ts">
import Button from '../lib/Button.vue'
export default {
    components:{ Button },
    setup(){
        const onClick=()=>{
            console.log('hi')
        }
        return{ onClick }
    }
}
</script>`
}}</code></pre>
            </main>
        </div>
    </div> 
</template>

<script lang="ts">
import {ref} from 'vue'
import Button from '../lib/Button.vue'
    export default {
        components:{ Button },
        setup(){
            const onClick=()=>{
                console.log('hi')
            }
            const code=ref(false)
            const getCode=()=>{
                code.value=!code.value
        }
            return{ code,getCode,onClick }
        }
    }
</script>

<style lang="scss" scoped>
.wrapper{
    max-width:800px;
    h2{
        padding-bottom: 30px;
        border-bottom: 1px solid rgb(212, 208, 208);
    }
    .shape{
        margin:30px 0px;
        >h3{
            margin-bottom: 10px;
        }
        >div{
            display: flex;
            padding: 10px;
            border:1px solid rgb(212, 208, 208);
        }
        .showButton{
            display: flex;
            flex-direction: column;
            flex-wrap: wrap;
            overflow: auto;
            
            >h4{
                margin-bottom:30px ;
            }
            >.zgn-button-show{
                display:flex;
                align-items: start;
                margin-bottom:20px ;
                >Button{
                    margin-right: 10px;
                }
            }
        }
    }
}
@media (max-width:500px) {
    .zgn-button-show{
        max-width: 300px;
        flex-direction: column;
        align-items: start;
        >Button{
            margin: 5px;
        }
    }
    .wrapper{
        max-width: 380px;
    }
              
}

</style>